<template>
	<!--  -->
	<view class="float" :style="{backgroundColor:value.backgroundColor?value.backgroundColor:'#fff'}">
	
		<view v-for="(item,index) in value.list" :key="index" @click="redirectTo(item.link.wap_url)">
			<view class="float_img">
				<image :src="$util.img(item.imageUrl)" mode="aspectFit"></image>
			</view>
			<view class="text ns-font-size-sm" v-if="item.title">{{item.title}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:'diy-float',
		props:{
			value: {
				type: Object
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			redirectTo(link){
				this.$util.redirectTo(link)
			}
		}
	}
</script>

<style lang="scss">
.float{
	position: fixed;
	bottom: 150rpx;
	right:30rpx;
	z-index:9999;
	max-height: 300rpx;
	width:60rpx;
	text-align: center;
	padding: 20rpx 10rpx;
	border-radius: 20rpx;
	box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.12);
	>view{
		margin-bottom: 30rpx;
		.float_img{
			margin: auto;
			width:40rpx;
			height:40rpx;
			border-radius: 50%;
			overflow: hidden;
			image{
				width: 100%;
				height: 100%;
			}
			
		}
		.text{
			line-height: 1;
			margin-top: 10rpx;
		}
		&:last-child{
			margin-bottom: 0;
		}
	}
	
}
</style>
